package day03;
import java.util.Scanner;
public class SelectDay {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		System.out.println("请输入年份(例如:2012)");
		int year = scan.nextInt();
		System.out.println("请输入月份(例如:1)");
		int month = scan.nextInt();
		boolean isLeapYear = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? true:false;
		//1、3、5、7、8、10、12月份31天,4、6、9、11月份30天,2月闰年29天平年28天
		if(isLeapYear) {
			switch(month) {
				case 1:
					System.out.println(year+"年"+month+"月有"+31+"天");
					break;
				case 2:
					System.out.println(year+"年"+month+"月有"+29+"天");
					break;
				case 3:
					System.out.println(year+"年"+month+"月有"+31+"天");
					break;
				case 4:
					System.out.println(year+"年"+month+"月有"+30+"天");
					break;
				case 5:
					System.out.println(year+"年"+month+"月有"+31+"天");
					break;
				case 6:
					System.out.println(year+"年"+month+"月有"+30+"天");
					break;
				case 7:
					System.out.println(year+"年"+month+"月有"+31+"天");
					break;
				case 8:
					System.out.println(year+"年"+month+"月有"+31+"天");
					break;
				case 9:
					System.out.println(year+"年"+month+"月有"+30+"天");
					break;
				case 10:
					System.out.println(year+"年"+month+"月有"+31+"天");
					break;
				case 11:
					System.out.println(year+"年"+month+"月有"+30+"天");
					break;
				case 12:
					System.out.println(year+"年"+month+"月有"+31+"天");
					break;
			}
		}else {
			switch(month) {
			case 1:
				System.out.println(year+"年"+month+"月有"+31+"天");
				break;
			case 2:
				System.out.println(year+"年"+month+"月有"+28+"天");
				break;
			case 3:
				System.out.println(year+"年"+month+"月有"+31+"天");
				break;
			case 4:
				System.out.println(year+"年"+month+"月有"+30+"天");
				break;
			case 5:
				System.out.println(year+"年"+month+"月有"+31+"天");
				break;
			case 6:
				System.out.println(year+"年"+month+"月有"+30+"天");
				break;
			case 7:
				System.out.println(year+"年"+month+"月有"+31+"天");
				break;
			case 8:
				System.out.println(year+"年"+month+"月有"+31+"天");
				break;
			case 9:
				System.out.println(year+"年"+month+"月有"+30+"天");
				break;
			case 10:
				System.out.println(year+"年"+month+"月有"+31+"天");
				break;
			case 11:
				System.out.println(year+"年"+month+"月有"+30+"天");
				break;
			case 12:
				System.out.println(year+"年"+month+"月有"+31+"天");
				break;
			}
		}
	}

}
